﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SARUserControls
{
	/// <summary>
	/// SARAddViewBtn.xaml 的交互逻辑
	/// </summary>
	public partial class SARAddViewBtn : UserControl
	{
		public SARAddViewBtn()
		{
			this.InitializeComponent();
		}

        public event MouseButtonEventHandler SARAddClick;
        public event MouseButtonEventHandler SARViewClick;

        private void gridAdd_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (SARAddClick != null)
            {
                SARAddClick.Invoke(this, e);
            }
        }

        private void gridView_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (SARViewClick != null)
            {
                SARViewClick.Invoke(this, e);
            }
        }

        private void gridAdd_MouseEnter(object sender, MouseEventArgs e)
        {
            gridAdd.Opacity = 0.1;
        }

        private void gridView_MouseEnter(object sender, MouseEventArgs e)
        {
            gridView.Opacity = 0.1;
        }

        private void gridAdd_MouseLeave(object sender, MouseEventArgs e)
        {
            gridAdd.Opacity = 0;
        }

        private void gridView_MouseLeave(object sender, MouseEventArgs e)
        {
            gridView.Opacity = 0;
        }
	}
}